DeltaChain Docs
Search…
🎯
Install

Requirements

Delta requires Go 1.12+ and C compiler to build.

#Getting the source

Clone the DeltaChain repo :
1
git clone https://github.com/deltachain/delta.git
2
cd delta
Copied!

#Dependency management

Simply run:
1
make dep
Copied!
If you keep getting network error, it is suggested to use Go Module Proxy.

#Building

To build the main app delta, just run
1
make
Copied!
or build the full suite:
1
make all
Copied!
If no error reported, all built executable binaries will appear in folder bin.

#Running Delta

Connect to DeltaChain's mainnet:
1
bin/delta --network main
Copied!
Connect to DeltaChain's testnet:
1
bin/delta --network test
Copied!
or startup a custom network
1
bin/delta --network <custom-net-genesis.json>
Copied!
example genesis config file can be found at genesis/example.json
To find out usages of all command line options:
1
bin/delta -h
Copied!
  • --network value the network to join (main|test) or path to genesis file
  • --data-dir value directory for block-chain databases
  • --cache value megabytes of ram allocated to internal caching (default: 2048)
  • --beneficiary value address for block rewards
  • --target-gas-limit value target block gas limit (adaptive if set to 0) (default: 0)
  • --api-addr value API service listening address (default: "localhost:8669")
  • --api-cors value comma separated list of domains from which to accept cross origin requests to API
  • --api-timeout value API request timeout value in milliseconds (default: 10000)
  • --api-call-gas-limit value limit contract call gas (default: 50000000)
  • --api-backtrace-limit value limit the distance between position and best block for subscriptions APIs (default: 1000)
  • --verbosity value log verbosity (0-9) (default: 3)
  • --max-peers value maximum number of P2P network peers (P2P network disabled if set to 0) (default: 25)
  • --p2p-port value P2P network listening port (default: 11235)
  • --nat value port mapping mechanism (any|none|upnp|pmp|extip:<IP>) (default: "none")
  • --bootnode value comma separated list of bootnode IDs
  • --skip-logs skip writing event|transfer logs (/logs API will be disabled)
  • --pprof turn on go-pprof
  • --disable-pruner disable state pruner to keep all history
  • --help, -h show help
  • --version, -v print the version

#Sub-commands

  • solo client runs in solo mode for test & dev
1
bin/delta solo --on-demand # create new block when there is pending transaction
2
bin/delta solo --persist # save blockchain data to disk(default to memory)
3
bin/delta solo --persist --on-demand # two options can work together
Copied!
  • master-key master key management
1
# print the master address
2
bin/delta master-key
3
​
4
# export master key to keystore
5
bin/delta master-key --export > keystore.json
6
​
7
​
8
# import master key from keystore
9
cat keystore.json | bin/delta master-key --import
Copied!

#Docker

This method needs running all commands by docker with the data directory mapped to the container.

#Pull image

1
docker pull deltachain/delta
Copied!

#Export Master Key

First, start an interactive shell by docker:
1
docker run -it --rm\
2
-v {path-to-your-data-directory}:/root/.org.deltachain.delta\
3
--entrypoint /bin/sh deltachain/delta
Copied!
Then export master key in the shell:
1
delta master-key --export > /root/.org.deltachain/keystore.json
Copied!
Enter your password and check the generated file, then exit.

#Import Master Key

1
docker run -it --rm\
2
-v {path-to-your-data-directory}:/root/.org.deltachain\
3
deltachain/delta master-key --import
Copied!
Follow the instruction by the program, input the KeyStore and also the password.

#Check Master Key

1
docker run -it --rm\
2
-v {path-to-your-data-directory}:/root/.org.deltachain\
3
deltachain/delta master-key
Copied!
This command will print the Master Key.

#Start the Authority Masternode

1
docker run -d\
2
-v {path-to-your-data-directory}:/root/.org.deltachain\
3
-p 127.0.0.1:8669:8669 -p 11235:11235 -p 11235:11235/udp\
4
--name delta-node deltachain/delta --network main --skip-logs
Copied!

#Public Nodes

Please visit Public Nodes for more information.