Initialize a New Repository

The last page describes how to register an existing local repository to the network. This page details how to initialize a new local repository and at the same time, register it on the network.

On this page, you will learn how to register and initialize a new repository using the repo init command. This command performs the following operations so you don’t have to:

  • Registers a repository on the network.

  • Initialize a local repository.

  • Adds the local node as a remote.

  • Configures the repository for pushing and pulling.

Create a key

Feel free to skip this section if you already have a key. If not see Key page to learn more.

Registering a new repository requires an identity. On MakeOS, keys offer a way for users to create an identity, authorize transactions, receive/send value and pay for services. You can create a key using the command below:

kit key create

You will be asked to provide a passphrase that will be used to encrypt the key in the keystore.

Get Test Coins

You can skip this section if you already have a key with some test coins.

Like most blockchains, MakeOS require users to pay a small fee to have transactions quickly processed. To continue following this guide, you will need some test coins in your newly created key. Copy your new address and go to our Testnet faucet to request for test coins.

Initialize a Repository

We are using express as the name of our test repository. If you are connected to the test network, you may need to use a different name since the name may no longer be available.

It is time to create your repository. The example below will register a new repository named express on the MakeOS network.

It will also initialize the repository in the current directory and configure it to make it easy for you to run git sign, fetch and pushing operations.

kit repo init "express" \
    -u="os150xvxt559v4n5530tw9y5tk2ghfflsczqxcdja" \
    -f="0.01"

The -u flag specifies the address of your new key; This key is known as the signing key. It is used to sign the transaction and will pay any network fee and deduction. You will be asked for the passphrase that will be used to unlock the signing key.

You can provide the keystore index of your signing key to -u instead of a full address.

By default, the signing key will be added as the first contributor (or Push Key) to the repository. It will also be used to sign future push requests.

The -f flag specifies the amount of fee you are willing to pay from your signing key to the network in other to create the repository. This fee will also be used as the transaction fee for future push requests.

You can change the fee by setting user.fee in git config, by running:

  • kit repo config -f=<your fee> or

  • git config user.fee <your fee>.

See the init command documentation for more options.

Start Pushing

By default, the init command will set origin remote to 127.0.0.1:9002 where it expects a Kit node to be running. At this point, we are assuming that you already have a running local node.

Every time you add a commit, Git will fire the post-commit hook which will cause Kit to sign your new commit and create a fresh push token that will be used to authenticate your push request.

Go ahead and create a commit and then push it.

git push origin <branch>  # Change <branch> to your own branch name 

You can change the remote URL it at any time by going to .git/config to edit remote's URL or using git remote set-url <remote> <url> command.

See the Quick Start Guide to learn how to start up a local node.

Seed Remote Nodes

To create a permission-less, un-censorable and un-stoppable code collaboration platform, it is important that users are able to run their own remote node. However, it can take some minutes for a remote node to sync up with the network causing users to wait for some time to push updates. We provide seed remote nodes for users who cannot wait to sync with the network or do not want to run or manage their own remote node.

Seed Remote Address

  • s1.seeders.live:9002

  • s2.seeders.live:9002

To make it easy for users to run their own node, we are working to make Kit support light client and fast sync modes that synchronizes with the network at a very fast rate and tracks only pre-selected repositories.

Add Seed Remote

You can add the seed remote URL to your repository using git remote command:

git remote add seed "http://s1.seeders.live:9002/r/<your-repo>"

Replace <your-repo> with the name of your own repository.

Last updated