In NEO, public key and public address are two different things.
If you wanna be an NEO developer, you need your NEO public key to apply testNet NEO&GAS, and it's kind of tricky to get your own public key. You cannot get it from a Neon Wallet, you need to use Neo CLI(command line interface). Today I'm here to show you how to create a new wallet and get your public key using NEO-CLI in Linux Ubuntu 16.04.
這陣子想要試試看在NEO上面的應用開發,所以要申請一下TestNet上面的NEO還有GAS。殊不知申請的步驟裡要輸入Public Key,而不是Public Address,搞的我一個頭兩個大。好不容易搞懂要用NEO的CLI(command line interface)才能看到自己的公鑰,只好親手來試試囉
It's actually very easy, all you have to do is download neo-cli, compile it and run some simple commands.
其實CLI真的沒有想像中可怕,但是看到黑底白字就會覺得好像要很專業才有辦法使用。其實整個過程也就只是安裝些套件,然後下點簡單指令罷了。所以我就紀錄一下在Ubuntu 16.04環境下如何創立新的錢包,並且讀取自己的Public Key吧!
1. install pre-requirements
sudo apt-get install libleveldb-dev sqlite3 libsqlite3-dev libunwind8-dev
2. You may also need to install dotnet core 2.0 for neo-cli to run(if you don't have it).
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
Then, update the package cache and install .NET Core
sudo apt-get update
sudo apt-get install dotnet-sdk-2.0.0
3. Download and unzip latest NEO-CLI realease
https://github.com/neo-project/neo-cli/releases
4. Go into the folder, run:
dotnet neo-cli.dll
You should be able to run NEO CLI!
You can type in help
and find some instructions about the commands
(And more detail here)
5. Now I want to create a new wallet, just type in create wallet [path under neo-cli/]
.
Remeber that the filename should be ended with .json
or .db3
You have successfully created a new wallet! You can copy your public key here right now.
6. In the future, you need your password to open the wallet to see your keys again. To open your wallet:
open wallet: [your wallet path]
With your wallet opened, you can now do a lot of stuff with the CLI!
I'm just using the CLI to get my public key so I can get some NEO and GAS on testNet ;)
That's it! Happy Developing on NEO!
謝謝大家,這一篇就這麼簡單的結束了xD一起來成為NEO的開發者吧!
《Anton Cheng》授權轉載
新增留言