Building Atlas requires git, Go (version 1.14 or higher), and a C compiler
Clone the code repository
gitclonehttps://github.com/mapprotocol/atlas.git
Build
We can start four nodes with different ports on a single host, or we can start four nodes on multiple hosts. The following example demonstrates starting four nodes with different ports on a single host.
gitcheckoutv1.1.5makeatlas
Create an account
Atlas allows developers to use Ethereum accounts on the Atlas blockchain. If you don't have an account, you can create one using the following command.
$./atlas--datadir./node-1accountnew$./atlas--datadir./node-2accountnew$./atlas--datadir./node-3accountnew$./atlas--datadir./node-4accountnew# OutputINFO [10-09|17:37:36.179]MaximumpeercountETH=100LES=0total=100Yournewaccountislockedwithapassword.Pleasegiveapassword.Donotforgetthispassword.Password:Repeatpassword:YournewkeywasgeneratedAddress:0x...PublicKey:0x...BLSPublickey:0x...BLSG1Publickey:0x...BLSProofOfPossession:0x...Pathofthesecretkeyfile:node-1/keystore/UTC--2023-10-09T09-37-38.019902000Z--...-Youcanshareyourpublicaddresswithanyone.Othersneedittointeractwithyou.-YoumustNEVERsharethesecretkeywithanyone!Thekeycontrolsaccesstoyourfunds!-YoumustBACKUPyourkeyfile!Withoutthekey,it's impossible to access account funds!- You must REMEMBER your password! Without the password, it'simpossibletodecryptthekey!
Generating genesis.json file
To generate the genesis.json file, please refer to this
Now we will use the information of the four accounts generated in the previous step to generate the genesis.json file. Fill in the corresponding key-value pairs in the markerConfig.json file with the information outputted when we created the accounts. The value for AdminAddress can be one of the four accounts we created earlier or any other account.
At this point, you will need to enter the password corresponding to the account and press Enter. Congratulations, you have successfully started one node. Then, you can start the remaining nodes in the same way.
If you want to start an RPC node, you can use the following method.
Before starting the nodes, make sure that the bootnode is running and accessible from the outside (try telnet to ensure it can be accessed). Then, use --bootnodes to point each subsequent Atlas node to the bootnode for peer discovery. Specify the data storage directory using --datadir.
After entering the command to connect to the node, you will start seeing some output. After a few minutes, you should see a line like this. This means that your node has connected to other nodes and will start generating blocks.
INFO [10-09|18:32:27.683]Lookingforpeerspeercount=2tried=5static=4INFO [10-09|18:32:37.582]ResettimertoresendRoundChangemsgaddress=0xB16561A66B6439944DAf0388b5E6a2D3D0a49e12func=resetResendRoundChangeTimercur_seq=23cur_epoch=1cur_round=0des_round=5state="Waiting for new round"address=0x2dC45799000ab08E60b7441c36fCC74060Ccbe11timeout=17.5sINFO [03-16|20:32:39.311]Lookingforpeerspeercount=3tried=0static=4
You can also use admin.peers command in the console to see the connected nodes.