Greens is a rails application that is used as a ARK minter and resolver
Install Ruby 2.5
Greens uses the config gem for application settings. Update the config/settings.yml
file with your configuration setup. You can also update the environment files in config/settings/
to overwrite the default settings.
Install gems and build the app
gem install bundler
bundle install
rake db:setup
Once setup you can continue to run the rails server according to your system environment.
You can run the full stack using docker locally.
Run the db:migrate for initial setup
docker-compose run --rm app rake db:migrate
This command starts the stack.
docker-compose up app
If you are upgrading from a previous version of Greens
- Upgrade to Ruby 2.5 or later
- cd into your greens installation
- Run
git pull
if you cloned from the repository bundle install
rake db:migrate
rake greens:migrate
- Copy your default environment settings from
config/app.yml
intoconfig/settings.yml
- Rename
api-key
toapikey
inconfig/settings.yml
- Remove
noid_state_file
setting inconfig/settings.yml
- If you have additional environment variables in
app.yml
you can place those settings in the appropriateconfig/settings/
location. - Delete
config/app.yml
file
Greens can be used as a Name Mapping Authority Hostport (NMAH) by having a URL in the format of http://example.com/ark:/12345/57x43/
. A request for a metadata erc record describing the object identified can be done by adding a '?' to the end of the request string http://example.com/ark:/12345/57x43/?
. You can view all the minted identifiers by going to http://example.com/ids
.
Suffix Passthrough allows you to add any suffix to the identifier which will be added to the end of the identifiers erc.where
url. For example having the ARK ark:/12345/57x43
with erc.where
equal to http://objects.com
will result in the ARK URL http://example.com/ark:/12345/57x43/object4/item2/thumbnail.jpg
redirecting to http://objects.com/object4/item2/thumbnail.jpg
.
Greens uses an REST API to mint, update, and destroy ARK identifiers.
To authenticate with these API calls, you will need to provide a application key which should be provided in a normal HTTP header called api-key
. This key is set in the config/app.yml
file.
Example
api-key: Dh7KgcDfUMeRmivTdSh1VY2i79qyigofckCiAivwjti89eAwkaKmPU0FH6NIs74
HTTP status code returned by a successful API will usually be 200 OK. All successful responses will return a JSON-encoded string.
/api/v1/arks/mint(/prefix)
Method: GET
Returns the minted identifier. /prefix is optional and allows every minted identifier to begin with the prefix string.
/api/v1/arks/mint(/prefix)
Method: POST
Returns the minted ark identifier. /prefix is optional and allows every minted identifier to begin with the prefix string.
Parameter | Description |
---|---|
who | The name of the entity (person, organization, or service) responsible for creating the content or making it available. |
what | A name or other human-oriented identifier given to the resource. |
when | A point or period of time important to the lifecycle of the resource. |
where | The identifier's target URL or location. |
/api/v1/id/{ark identifier}
Method : PUT
Returns the updated object erc
Parameter | Description |
---|---|
who | The name of the entity (person, organization, or service) responsible for creating the content or making it available. |
what | A name or other human-oriented identifier given to the resource. |
when | A point or period of time important to the lifecycle of the resource. |
where | The identifier's target URL or location. |
/api/v1/id/{ark identifier}
Method: DELETE
Deletes the given identifier. This can not be un-done.